package cn.iocoder.yudao.module.book.controller.app.protocolAndmethod;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.book.controller.app.protocolAndmethod.vo.AppMethodsRespVO;
import cn.iocoder.yudao.module.book.controller.app.protocolAndmethod.vo.AppProtocolRespVO;
import cn.iocoder.yudao.module.book.service.methods.MethodsService;
import cn.iocoder.yudao.module.book.service.protocol.ProtocolService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Tag(name = "APP - 协议")
@RestController
@RequestMapping("/api/user/setting")
//测试 完成
public class AppProtocolController {

    @Resource
    private ProtocolService protocolService;
    @Resource
    private MethodsService methodsService;

    @GetMapping("/agreementList")
    @Operation(summary = "获取协议列表")
    public CommonResult<AppProtocolRespVO> agreementList() {
        return CommonResult.success(protocolService.getAll());
    }


    @GetMapping("/defaults")
    @Operation(summary = "获取启蒙方法")
    public CommonResult<AppMethodsRespVO> defaults() {
        return CommonResult.success(methodsService.getMethod());
    }
}
